import React, { useState, useEffect } from 'react'
import axios from 'axios'
import { ProductCard } from 'react-vant';
const MyList = () => {
    const [list, setList] = useState([])
    const [pageCode,setPageCode]=useState(1)
    const getData = async () => {
        const res = await axios.get("/room/list",{params:{pageCode}})
        // console.log(res.data);
        setList([...list,...res.data.data])
        setPageCode(pageCode + 1)
    }
    useEffect(() => {
        getData()
    }, [])
    return (
        <div>
            {
                list && list.map((v, i) => {
                    return <ProductCard
                        key={i}
                        title={v.title}
                        thumb={v.image}
                    />
                })
            }
        </div>
    )
}

export default MyList
